%% Performance Evaluation of EW UEP RLNC Coding Scheme (Plotter fct)
%
% Author: 12GR652
% Last modified: 26-04-2012
%
% Description:
% This script produces the figure based on the simulated data
%

%% Startup

% Clear workspace
close all
clear all
clc
%% Plotting

% Load data that has already been generated
load('ewrlnc_data')

% quick fix of x vector - must be the same sequence as in for-loop
nb_transmissions = 1:1:(3*gen_size);

% Suppress graphic output (better for terminal execution)
% figure('visible','off');

figure(1)

% Fill plot with data
hold on
plot(I_prob(:,2).*nb_sims,I_prob(:,1),'-*','MarkerSize',3.5,'Color','black');
plot(P1_prob(:,2).*nb_sims,P1_prob(:,1),'-o','MarkerSize',3.5,'Color','black');
% plot(P2_prob(:,2).*nb_sims,P2_prob(:,1),'-d','MarkerSize',3.5,'Color','black');
% plot(EEP_prob(:,2).*nb_sims,EEP_prob(:,1),'--','MarkerSize',3.5,'Color','black');
hold off

% Plot Annotation
xlabel('Received Packets [-]')
ylabel('Probability of Decoding [-]')

label_1=strcat('L1  (L_1 = ',num2str(I_pkts),', \Gamma_1 = ',num2str(R1),')');
label_2=strcat('L2  (L_2 = ',num2str(I_pkts+P1_pkts),', \Gamma_2 = ',num2str(R2),')');
% label_3=strcat('L3  (L_3 = ',num2str(I_pkts+P1_pkts+P2_pkts),', \Gamma_3 = ',num2str(R3),')');
% label_4=strcat('EEP (g = ',num2str(I_pkts+P1_pkts+P2_pkts),')');
legend(label_1,label_2,'location','SouthEast')
legend_handle=legend;
set(legend_handle,'interpreter','tex')

grid('on')
pbaspect([2.5 1 1])
set(gca,'XTick',0:10:3*gen_size)
xlim([0 3*gen_size])

% Save figure
print(gcf,filename_fig)






